// ignore_for_file: prefer_interpolation_to_compose_strings, sized_box_for_whitespace, prefer_const_constructors

import 'package:flutter/material.dart';
import 'package:get/get.dart';

class ThemeView extends StatelessWidget {
  const ThemeView({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title:const Text("主题"),
      ),
      body: Center(
        child: Column(
          children: <Widget>[
            Container(
              height: 100,
              child: Align(
                alignment: Alignment.center,
                child: Text('是否是黑色主题 -> '+Get.isDarkMode.toString()),
              ),
            ),
            Divider(),
            ListTile(
              title: Text('切换主题'),
              subtitle: Text('Get.changeTheme'),
              onTap: () {
                Get.changeTheme(
                  Get.isDarkMode ? ThemeData.light() : ThemeData.dark()
                );
              },
            )
          ],
        ),
      ),
    );
  }
}